package chips440.tiles;

import java.applet.Applet;
import java.applet.AudioClip;
import java.awt.image.BufferedImage;
import chips440.internals.Player;
import chips440.main.Types;

/**
 * This tile kills any player that steps on it without wearing water boots
 * (flippers).
 *
 * @author Ryan Hofler
 * @version 0.1
 */
public class WaterTile extends Tile{
	private AudioClip water;
    /**
     * Makes a new WaterTile
     */
    public WaterTile(){
	this.image = chips440.main.ResourceCache.getImage("water");
	this.water = chips440.main.ResourceCache.getSound("WATER.WAV");
    }

    public Types.TileAct okToStep(Player player){
	    water.play();
        if(player.hasItem(Types.Item.W_BOOT))
            return Types.TileAct.MOVE;
        return Types.TileAct.KILL;
    }   
}
